package com.example.test2;

import java.util.Arrays;
import java.util.function.Supplier;

public class SupplierTest {

    public static void main(String[] args) {
        fun1(() -> {
            int[] arr = {22, 33, 44};
            Arrays.sort(arr);
            return arr[arr.length - 1];
        });
    }

    private static void fun1(Supplier<Integer> supplier) {
        Integer max = supplier.get();
        System.out.println(max);
    }

}
